from flask_classy import FlaskView, route
from ..contril import FundChannel
from ..schema.object import fund_channels_schema
from . import jsonify_with_success


class FundChannelsView(FlaskView):
    @route('/')
    def all_channels(self):
        channels = FundChannel.all()


        if channels.success:
            return jsonify_with_success(
                {'result': fund_channels_schema.dump(channels.items).data})
